package attributes;

import genetics.HaploidAttribute;

/**
 * 
 * @author Nicolas Winkler
 */
public class UdderSize extends HaploidAttribute {
	
	/**
	 * the size of the udder
	 */
	float size;
	
	
	@Override
	public HaploidAttribute intermediary(HaploidAttribute b) {
		if (b instanceof UdderSize) {
			UdderSize bus = (UdderSize) b;
			UdderSize us = new UdderSize();
			us.size = (size + bus.size) * 0.5f * (1f + (float) Math.random() * 0.02f - 0.01f);
		}
		return null;
	}

	@Override
	public HaploidAttribute mitosis() {
		UdderSize us = new UdderSize();
		us.size = size * (1f + (float) Math.random() * 0.02f - 0.01f);
		return us;
	}
}
